import Vue from 'vue';
import Router from 'vue-router';
import HelloWorld from '@/components/HelloWorld';
import companyInfo from '@/components/company_info';
import home from '@/components/home_page';
import product from '@/components/products';
import contact from '@/components/contact_us';

Vue.use(Router);

export default new Router({
  routes: [
    {
      path: '/helloWorld',
      name: 'HelloWorld',
      component: HelloWorld
    },
    {
      path: '/',
      name: 'home',
      component: home
    },
    {
      path: '/products',
      name: 'products',
      component: product
    },
    {
      path: '/info',
      component: companyInfo
      // 使用 children 属性，实现子路由，同时，子路由的 path 前面，不要带 / ，否则永远以根路径开始请求，这样不方便我们用户去理解URL地址
      // children: [
      //   { path: '/', component: home },
      //   { path: '0', component: home },
      //   { path: '1-1', component: loveList },
      //   { path: '2-1', component: settingList }

      // ]
    }, {
      path: '/contact',
      component: contact
    }
  ]
});
